[XEN] Fix mapping of p2m into monitor tables for external-mode guests.
authorTim Deegan <tim.deegan@xensource.com>
Sat, 2 Sep 2006 11:11:54 +0000 (12:11 +0100)
committerTim Deegan <tim.deegan@xensource.com>
Sat, 2 Sep 2006 11:11:54 +0000 (12:11 +0100)
The previous code could map frame zero into the P2M table on PAE hosts.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
xen/arch/x86/mm/shadow/multi.c

index e6210cc7fab07b9fe27721d1c7635a768ebcaf19..ace6a258f393b95bf1d6056c40dddb8976b49729 100644 (file)
@@ -1792,8 +1792,10 @@ void sh_install_xen_entries_in_l2h(struct vcpu *v,
         for ( i = 0; i < MACHPHYS_MBYTES>>1; i++ )
         {
             sl2e[shadow_l2_table_offset(RO_MPT_VIRT_START) + i] =
-                shadow_l2e_from_mfn(_mfn(l3e_get_pfn(p2m[i])),
-                                    __PAGE_HYPERVISOR);
+                (l3e_get_flags(p2m[i]) & _PAGE_PRESENT)
+                ? shadow_l2e_from_mfn(_mfn(l3e_get_pfn(p2m[i])),
+                                      __PAGE_HYPERVISOR)
+                : shadow_l2e_empty();
         }
         sh_unmap_domain_page(p2m);
     }